package io.github.bigbird0101.datatransfer.container;

import integration.data.task.reader.CommonStreamReader;
import integration.data.task.reader.KafkaReader;
import integration.data.task.reader.Reader;
import integration.data.task.reader.StreamReader;
import integration.modle.exception.IntegrationValidException;

import static io.github.bigbird0101.datatransfer.constants.Constant.*;

public class ReaderProcessor {


    public static Reader getReaderName(String readerName) {
        switch (readerName) {
            case READER_PLUGIN_MQ:
            case READER_PLUGIN_API:
                return new CommonStreamReader();
            case READER_PLUGIN_KAFKA:
                return new KafkaReader();
            case READER_PLUGIN_STREAM:
                return new StreamReader();
            default:
                throw new IntegrationValidException(String.format("不支持读取类型: %s", readerName));
        }
    }
}
